import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'account/add',
    method: 'post',
    data
  })
}

export function forbidden(id) {
  return request({
    url: 'account/forbidden/' + id,
    method: 'post'
  }, true)
}

export function enable(id) {
  return request({
    url: 'account/enable/' + id,
    method: 'post'
  })
}

export function edit(data) {
  return request({
    url: 'account/update',
    method: 'post',
    data
  })
}

export function validPass(password) {
  const data = {
    password
  }
  return request({
    url: 'account/validPass',
    method: 'post',
    data
  })
}

export function updatePass(password) {
  const data = {
    password
  }
  return request({
    url: 'account/updatePass',
    method: 'post',
    data
  })
}

export function updateEmail(code, data) {
  return request({
    url: 'account/updateEmail/' + code,
    method: 'post',
    data
  })
}

